From: Xenofon Karamanos Date: Tue, 31 Mar 2026 10:52:11 +0000 (+0000) Subject: ims_ocs: Free after copying the values X-Git-Tag: archive/raspbian/6.0.1-1+rpi1+deb13u2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=23a284978451cad6980b4e2a1fa91d677a019704;p=kamailio.git ims_ocs: Free after copying the values - Remove extra freeavplist call - Add len check (cherry picked from commit a56942affd35d41890c23f1d3b5bb519f87ef5ad) Gbp-Pq: Topic upstream Gbp-Pq: Name ims_ocs-Free-after-copying-the-values.patch --- diff --git a/src/modules/ims_ocs/ocs_avp_helper.c b/src/modules/ims_ocs/ocs_avp_helper.c index f350a79a..378b2a20 100644 --- a/src/modules/ims_ocs/ocs_avp_helper.c +++ b/src/modules/ims_ocs/ocs_avp_helper.c @@ -208,8 +208,7 @@ int getUnits(AAAMessage *msg, int *used, int *service, int *group) list2 = cdp_avp->cdp->AAAUngroupAVPS(req_units->data); value = cdpb.AAAFindMatchingAVPList( list2, list2.head, AVP_CC_Time, 0, 0); - cdpb.AAAFreeAVPList(&list2); - if(value) + if(value && value->data.len >= 4) units = get_4bytes(value->data.s); cdpb.AAAFreeAVPList(&list2); }